/*
 * 百度在线网络技术（北京）有限公司拥有本软件版权2022并保留所有权利。
 * Copyright 2022, Baidu.com,Inc 2:Baidu Online Network Technology (Beijing) Co.,Ltd,
 * All rights reserved.
 */

package com.azdebugit.sync.hronized.test;

public class SynObj{
    public synchronized void showA(){
        System.out.println("showA..");
        try {
            Thread.sleep(30);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public void showB(){
        synchronized (this) {
            System.out.println("showB..");
        }
    }

    public void showC(){
        String s="1";
        synchronized (s) {
            System.out.println("showC..");
        }
    }
}